﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ToolBoxPro;
using LinqObj;

public partial class office_detail : RedirectPage
{
    private int agentGroupID;
    private Agent_Group group;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ((Label)Master.FindControl("lblTitle")).Text = "My Office";
            ((System.Web.UI.HtmlControls.HtmlImage)Master.FindControl("imgHeading")).Src = "images/icon_office.gif";
        }

        this.agentGroupID = Convert.ToInt32(Session[FormContract.AGENT_GROUP_ID]);
        this.group = Agent_Group.GetAgentGroup(this.agentGroupID);
        bindData();
    }

    private void bindData()
    {
        this.lb_detail.Text = group.agent_group_detail;
        this.lb_office.Text = group.agent_group_name;
        this.lb_phone.Text = group.phone_number;
        foreach (Agent agent in group.Agents)
        {
            this.lb_officer_name.Text = agent.agent_name + agent.email_address + "\n";
        }
    }
}
